<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>编辑作者 - {{ author.name }}</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 20px;
            max-width: 600px;
            margin: 0 auto;
            padding: 20px;
        }
        h1 {
            color: #333;
        }
        .form-group {
            margin-bottom: 15px;
        }
        label {
            display: block;
            margin-bottom: 5px;
            font-weight: bold;
        }
        input[type="text"], textarea, input[type="date"] {
            width: 100%;
            padding: 8px;
            border: 1px solid #ddd;
            border-radius: 4px;
            box-sizing: border-box;
        }
        textarea {
            resize: vertical;
            height: 100px;
        }
        .form-actions {
            margin-top: 20px;
        }
        .submit-button {
            background-color: #4CAF50;
            color: white;
            padding: 10px 20px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }
        .cancel-link {
            margin-left: 10px;
            color: #666;
            text-decoration: none;
        }
    </style>
</head>
<body>
    <h1>编辑作者</h1>
    <form method="post">
        {% csrf_token %}
        <div class="form-group">
            <label for="name">姓名:</label>
            <input type="text" id="name" name="name" value="{{ author.name }}" required>
        </div>
        <div class="form-group">
            <label for="bio">简介:</label>
            <textarea id="bio" name="bio">{{ author.bio }}</textarea>
        </div>
        <div class="form-group">
            <label for="birth_date">出生日期:</label>
            <input type="date" id="birth_date" name="birth_date" value="{{ author.birth_date|date:'Y-m-d'|default:'' }}">
        </div>
        <div class="form-actions">
            <button type="submit" class="submit-button">保存</button>
            <a href="{% url 'author_detail' author.id %}" class="cancel-link">取消</a>
        </div>
    </form>
</body>
</html>
